Requesting a document name

In the collaborating vaults other than where the NextDocumentName function is defined (and the sequence numbers are stored), the naming function must be called when a new document is created. The display name of the document type should be passed and the returned number should be used as the new document name. This is best implemented in the DocGenericEvent_AfterNewDocument event handler as shown in the following example.

Sub DocGenericEvent_AfterNewDocument (Batch, Action, SourceFile, DocType, DocTemplate)
  GCFDocGeneric_AfterNewDocument Batch, Action, SourceFile, DocType, DocTemplate
  Set objGCF = AMCreateObject ("BlueCieloECM.GcfSupport", False)
  v = Document.DocumentType.DisplayName
  Document.FileName = objGCF.CallRemote "NumberVault", _
                      "NextDocumentName", Document.GlobalID, v) & ".Txt"
  Set objGCF = Nothing
End Sub

For information on modifying this procedure for when the hub vault is not available, see Handling hub vault unavailability.

Related concepts

Centralizing sequence number generation

Understanding table data replication

Related tasks

Transferring ownership upon release

Calculating import notification messages

UpdateTable example

Executing remote script functions

Calculating document names

Handling hub vault unavailability

Enlisting all sites for new documents

Customizing site delistment